// 类型
import { INITTOPIC, GETTOPICDATA } from "../types/TopicType";
// 请求
import { getTopicData } from "../../data/api";
// 组件
export const initTopicAction = () => {
  return {
    type: INITTOPIC,
    payload: 1,
  };
};
// 获取页面详情
export const getTopicAction = (payload) => {
  return async (dispatch) => {
    let res = await getTopicData(payload.id);
    if (res.success) {
      dispatch({
        type: GETTOPICDATA,
        payload: res,
      });
    }
  };
};
